﻿using System.Data;
using System;
using test_newtonsoft.Types;
using test_newtonsoft.Extenteds;
using Newtonsoft.Json;



// 创建一个 person
/* var person = new Person
{
    FirstName = "Person FirstName",
    LastName = "Person LastName",
    BirthDate1 = new int[] {
                    1, 2, 3
                }
};
var employee = new Employee
{
    FirstName = "Employee FirstName",
    LastName = "Employee LastName",
    BirthDate2 = new int[] {
                    1, 2, 3
                }
};
var _employee = person.Convert<Employee>();
Console.WriteLine(_employee.BirthDate2);
Console.WriteLine($"Person to Employee: {_employee.GetType().Name}");
var _person = employee.Convert<Person>();
Console.WriteLine($"Employee to Person: {_person.GetType().Name}"); */

// 不合法的 JSON 需要提前 fix，https://stackoverflow.com/questions/28383478/most-efficient-way-to-fix-an-invalid-json
var str = @"{'server' : [
    [
        'yiyiyi', 1111
    ]
]}";

var server = str.ConvertObject<ServerType>();


Console.WriteLine(server);